﻿package mortal.game.view.wardrobe.view
{
    import Message.Public.*;
    import com.mui.controls.*;
    import com.mui.display.*;
    import flash.events.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;

    public class WardrobeCategoryCellRenderer extends GCellRenderer
    {
        private var _wardrobeBtn:GLoadingButton;
        private var _selectBg:ScaleBitmap;
        private var _wardrobeType:int;

        public function WardrobeCategoryCellRenderer()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            return;
        }// end function

        override public function set selected(param1:Boolean) : void
        {
            super.selected = param1;
            this._selectBg.visible = param1;
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            var _loc_2:String = null;
            super.data = param1;
            this._wardrobeType = param1 as int;
            switch(this._wardrobeType)
            {
                case EAdvanceComponentType._EAdvanceComponentTypeMount:
                {
                    _loc_2 = ResFileConst.WardrobeMountBtn;
                    break;
                }
                case EAdvanceComponentType._EAdvanceComponentTypePet:
                {
                    _loc_2 = ResFileConst.WardrobePetBtn;
                    break;
                }
                case EAdvanceComponentType._EAdvanceComponentTypeWing:
                {
                    _loc_2 = ResFileConst.WardrobeWingBtn;
                    break;
                }
                case EAdvanceComponentType._EAdvanceComponentTypeClothes:
                {
                    _loc_2 = ResFileConst.WardrobeClothBtn;
                    break;
                }
                case EAdvanceComponentType._EAdvanceComponentTypeWeapon:
                {
                    _loc_2 = ResFileConst.WardrobeArtifactBtn;
                    break;
                }
                default:
                {
                    break;
                }
            }
            this._wardrobeBtn = UIFactory.gLoadingButton(_loc_2, 0, 0, 119, 95, this);
            this._wardrobeBtn.configEventListener(MouseEvent.CLICK, this.onClickHandler);
            this._selectBg = UIFactory.bg(-2, -2, 120 + 3, 96 + 4, this, ImagesConst.selectFilter);
            this._selectBg.visible = false;
            return;
        }// end function

        private function onClickHandler(event:MouseEvent) : void
        {
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._wardrobeBtn.dispose();
            this._wardrobeBtn = null;
            this._selectBg.dispose();
            this._selectBg = null;
            return;
        }// end function

    }
}
